package com.nbsaas.boot.merchant.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.math.BigDecimal;
import java.util.Date;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "商家统计", model = "商家统计")
@Entity
@Table(name = "bs_merchant_statistics")
@Comment("商家统计表")
public class MerchantStatistics extends AbstractEntity {

    @Comment("商家ID")
    @FormField(title = "商家", sortNum = "1", type = InputType.select, required = true)
    private Long merchantId;

    @Comment("统计日期")
    @SearchItem(name = "statisticsDate", key = "statisticsDate", label = "统计日期")
    @FormField(title = "统计日期", sortNum = "2", grid = true, type = InputType.date, required = true)
    private Date statisticsDate;

    @Comment("订单数量")
    @FormField(title = "订单数量", sortNum = "3", type = InputType.el_input_number, grid = true)
    private Integer orderCount;

    @Comment("订单金额")
    @FormField(title = "订单金额", sortNum = "4", type = InputType.el_input_number, grid = true)
    @Column(precision = 12, scale = 2)
    private BigDecimal orderAmount;

    @Comment("退款数量")
    @FormField(title = "退款数量", sortNum = "5", type = InputType.el_input_number, grid = true)
    private Integer refundCount;

    @Comment("退款金额")
    @FormField(title = "退款金额", sortNum = "6", type = InputType.el_input_number, grid = true)
    @Column(precision = 12, scale = 2)
    private BigDecimal refundAmount;

    @Comment("佣金金额")
    @FormField(title = "佣金金额", sortNum = "7", type = InputType.el_input_number, grid = true)
    @Column(precision = 12, scale = 2)
    private BigDecimal commissionAmount;

    @Comment("浏览量")
    @FormField(title = "浏览量", sortNum = "8", type = InputType.el_input_number, grid = true)
    private Integer viewCount;

    @Comment("收藏数")
    @FormField(title = "收藏数", sortNum = "9", type = InputType.el_input_number, grid = true)
    private Integer favoriteCount;

    @Comment("评价数")
    @FormField(title = "评价数", sortNum = "10", type = InputType.el_input_number, grid = true)
    private Integer reviewCount;

    @Comment("平均评分")
    @FormField(title = "平均评分", sortNum = "11", type = InputType.el_input_number, grid = true)
    @Column(precision = 3, scale = 2)
    private BigDecimal avgRating;
} 